<!--  -->
<template>
  <div class='op'>
    <div class="toP">
      <p class="toP-p">操作日志</p>
    </div>
    <div class="forM">
      <div class="forM-fm">
        <p class="forM-p1">
          <i class="el-icon-menu"></i>筛选
        </p>
        <div class="forM-el">
          <span>操作人：</span>
          <select class="forM-selecr">
            <option value="volvo">请选择</option>
            <option value="admin">admin</option>
            <option value="daisy">daisy</option>
            <option value="john">john</option>
          </select>
          <span class="forM-el-XiaDan">下单时间：</span>
          <el-date-picker v-model="value1" type="date" placeholder="开始日期"></el-date-picker>--
          <el-date-picker v-model="value1" type="date" placeholder="结束日期"></el-date-picker>
          <el-button
            type="primary"
            icon="el-icon-s-check"
            style="width: 100px;height: 40px;margin-left: 30px; background: #9137f3;"
            @click="lookup"
          >筛选</el-button>
          <span class="forM-el-inps" @click="empty">清空筛选条件</span>
        </div>
      </div>
    </div>
    <!--结束-->
    <div class="warp">
      <div class="warp-box">
        <p class="warp-p">
          <i class="el-icon-s-fold"></i>流水列表
        </p>
        <div class="warp-div">
          <span>操作人</span>
          <span>操作模块</span>
          <span>操作时间</span>
          <span>操作内容</span>
        </div>
        <div id="inps">
          <div>
            <el-table :data="tableData" style="width: 100%;font-size: 12px;">
              <el-table-column prop="date" width="310"></el-table-column>
              <el-table-column prop="name" width="280"></el-table-column>
              <el-table-column prop="address" width="330"></el-table-column>
              <el-table-column prop="mini" width="0"></el-table-column>
            </el-table>
          </div>
        </div>
        <div class="wrap-box-paging">
          <div class="wrap-box-pagingS">
            <el-pagination background layout="prev, pager, next" :total="100" style="color:red"></el-pagination>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      tableData: [
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
      ],
      //备份
      abc:[
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "admin",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "daisy",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
        {
          date: "john",
          name: "订单管理",
          address: "2019-01-25 10:55",
          mini: "确认订单",
        },
      ],
      //日期
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", date);
            },
          },
          {
            text: "一周前",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", date);
            },
          },
        ],
      },
      value1: "",
      value2: "",
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    empty: function () {
      let inp = document.getElementsByClassName("forM-selecr")[0];
       inp.value = "volvo";
       this.tableData=this.abc
    },
    lookup: function () {
        this.tableData=this.abc
      let inpdata = [];
      let inp = document.getElementsByClassName("forM-selecr")[0];
      for (let j = 0; j < this.tableData.length; j++) {
        if (inp.value.trim() === this.tableData[j].date) {
          inpdata.push(this.tableData[j]);
        }
      }
      this.tableData = inpdata;
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style  scoped>
* {
  margin: 0;
  padding: 0;
}
html {
  width: 100%;
  height: 100%;
}
.op{
  width: 1140px;
  height: 100%;
  margin: 0 auto;
}
.toP {
  width: 100%;
  height: 70px;
}
.toP-p {
  margin: auto;
  line-height: 70px;
  font-family: "思源黑体 Bold", "思源黑体";
  font-weight: 700;
  font-style: normal;
  font-size: 24px;
  margin-left: 20px;
  color: #9137f3;
}
.forM {
  width: 100%;
  /* background: skyblue; */
}
.forM-fm {
  margin: auto;
  width: 1100px;
  height: 134px;
  /* background: snow; */
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 0px;
  border: 1px solid rgb(228, 228, 228);
  border-radius: 1px;
  color: black;
}
.forM-p1 {
  color: rgb(153, 153, 153);
  font-size: 15px;
}
.forM-selecr {
  font-size: 12px;
  width: 182px;
  height: 36px;
}
.forM-el {
  font-size: 14px;
  margin-top: 35px;
}
.forM-el-inp {
  width: 170px;
  height: 35px;
  border: 1px solid rgb(228, 228, 228);
  padding: 10px;
}
.forM-el-XiaDan {
  margin-left: 40px;
  margin-right: 40px;
}
.forM-el-inps {
  font-size: 12px;
  margin-left: 10px;
  color: #9137f3;
}
.warp {
  width: 100%;
}
.warp-box {
  width: 1100px;
  height: 100%;
  margin: auto;
  margin-top: 20px;
  border: 1px solid rgb(228, 228, 228);
  padding: 30px;
}
.warp-div {
  width: 1042px;
  height: 60px;
  margin-top: 30px;
  text-align: center;
  line-height: 60px;
}
.warp-div span {
  font-size: 14px;
  float: left;
  display: block;
  margin-left: 250px;
  font-weight: bold;
  text-align: center;
}
.warp-div span:nth-child(1) {
  margin-left: 20px;
}
.wrap-box-paging {
  height: 100px;
}
.wrap-box-pagingS {
  float: right;
  margin-top: 50px;
}
</style>